package cn.stronglink.assetmanage.business.setting.ipset;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import cn.stronglink.assetmanage.business.setting.SystemInfoFragment;
import cn.stronglink.assetmanage.business.setting.synchronously.SystemSyncTypeFragment;
import cn.stronglink.assetmanage.business.setting.syncset.SystemSyncContentFragment;

/**
 * @author zww
 * 2018 2018/6/17 21:42
 */
public class SystemViewPagerAdapter extends FragmentPagerAdapter {
    private String[] titles;

    SystemViewPagerAdapter(FragmentManager fm, String[] pageTitleAr) {
        super(fm);
        this.titles = pageTitleAr;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        switch (position) {
            case 0:
                fragment = new SystemServerConfigFragment();
                break;
            case 1:
                fragment = new SystemSyncContentFragment();
                break;
            case 2:
                fragment = new SystemSyncTypeFragment();
                break;
            case 3:
                fragment=new SystemInfoFragment();
                break;
            default:
                //fragment = new SystemServerConfigFragment();
                break;
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
